package com.fix.day3jdbc.dao.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import com.fix.day3jdbc.dao.StudentDao;
import com.fix.day3jdbc.entity.Student;

@Repository
public class StudentDaoImpl implements StudentDao {
	
	@Autowired
	JdbcTemplate jdbc;

	public void addStu(Student st) {
		
		String sql="INSERT INTO student(stname,sex,phone) VALUES(?,?,?)";
		jdbc.update(sql,st.getStname(),st.getSex(),st.getPhone());
	}

}
